<template>
<div>
    <!-- <div class="bodyBox"> -->
    <div class="box">
        <div class="img">
            <img :src='val' alt="">
        </div>
        <span @click="spanFn(value)">{{value}}</span>
        
    <!-- </div> -->
  </div>
</div>

</template>

<script>
export default {
    props:['val','value'],
    methods:{
        spanFn(i) {
            // console.log(i);
            this.$emit('loveDog',i)
        }
    }
}
</script>

<style>
.bodyBox {
  width: 1200px;
  height: 600px;
  background-color: aquamarine;
}

.box {
    width: 300px;
    height: 300px;
    border: 1px solid #333;
    float: left;
}
.img {
    width: 300px;
    height: 250px;
    background-color: blue;
}
.box span {
    display: inline-block;
    width: 300px;
    text-align: center;
    line-height: 50px;
}
.img img{
    width: 100%;
    height: 100%;
}
</style>